#include "e2d/imgui/render/Editor.h"
#include "e2d/core/render/components.h"
#include "e2d/ui/Utils.h"

using Editor = e2d::BasicEditor;

template<>
bool Editor::Edit<e2d::FixedMeshRender>(const std::string& label, e2d::FixedMeshRender& e)
{
	auto& sg = e2d::State::Inst();

	bool flag{0};

	int index = 0;

	flag |= EditInst<e2d::MaterialViewMap>("m_MaterialView", e.m_MaterialView);

	if (ImGui::Button("View"))
	{
		sg.m_EditMaterialFlag = true;
		sg.m_EditMaterialPath = e.m_MaterialView.m_Index.m_TargetFilePath;
	}

	flag |= EditInst<e2d::MeshMap>("m_MeshMap", e.m_MeshMap);

	if (ImGui::Button("Load"))
	{
		e.OnLoad();
	}


	return false;
}